import request from '@/utils/request'

export function getCateApi () {
  return request.get('/my/cate/list')
}

export function addCateApi (data) {
  return request.post('/my/cate/add', data)
}

export function getCateDetailApi (id) {
  return request.get('/my/cate/info', {
    params: { id }
  })
}

export function delCateApi (id) {
  return request.delete('/my/cate/del', {
    params: { id }
  })
}

export function publishArticleApi (data) {
  return request.post('/my/article/add', data)
}

export function getArticleApi (params) {
  return request.get('/my/article/list', {
    params
  })
}

export function getDetailApi (id) {
  return request.get('/my/article/info', {
    params: { id }
  })
}
export const delArticleApi = id => request.delete('/my/article/info', { params: { id } })
